package com.example.demo.mapper;

import com.example.demo.pojo.UserInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface UserInfoMapper {
    @Select("select * from userinfo where uid=#{uid}")
    public UserInfo getUserInfoById(Integer uid);

    @Delete("delete from userinfo where uid=#{uid}")
    public int deleteUserinfoById(Integer uid);

    @Insert("insert into userinfo values(#{uid},#{uname},#{password},#{phone},#{sex},#{address})")
    public int insertUserInfo(UserInfo userInfo);

    @Update("update userinfo set address=#{address} where uid=#{uid}")
    public int updateUserInfo(UserInfo userInfo);
}
